package cn.xinfang.test.controller;

import cn.xinfang.test.doman.User;
import cn.xinfang.test.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Author pf
 * @Date 2021/10/6 20:32
 * @Version 1.0
 */
@Controller
@RequestMapping("/test")
public class UserController {

    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/query")
    @ResponseBody
    public List<User> queryUsers(){
        List<User> users = userMapper.queryUserList();
        return users;

    }

}
